<?php
/*  
  Copyright (c) 2010-02 SongCMS 
  SongCMS All Rights Reserved. 
  Support:www.SongCMS.com
  QQ:544255858   19951025
  Author:Song  Version:3.17
  Date:2010-08-12 09:28:32
*/

include_once('Admin.php');
if ($_POST['Action']=='UpDate'){
	$SQL = "UPDATE `" . $dbprefix . "webconfig` SET 
	`WebTitle` = '" . $_POST['WebTitle'] . "',
	`WebLogo` = '" . $_POST['WebLogo'] . "',
	`WebDescription` = '" . $_POST['WebDescription'] . "',
	`Webkeyword` = '" . $_POST['Webkeyword'] . "',
	`WebCopyright` = '" . $_POST['WebCopyright'] . "',
	`WebEmail` = '" . $_POST['WebEmail'] . "',
	`WebQQ` = '" . $_POST['WebQQ'] . "',
	`WebMSN` = '" . $_POST['WebMSN'] . "',
	`WebTel1` = '" . $_POST['WebTel1'] . "',
	`WebTel2` = '" . $_POST['WebTel2'] . "',
	`WebFax` = '" . $_POST['WebFax'] . "',
	`WebAddress` = '" . $_POST['WebAddress'] . "',
	`WebIP` = '" . $_SERVER['REMOTE_ADDR'] . "',
	`WebDate` = NOW(),
	`WebAdminName` = '" . $_SESSION['UserName'] . "'
	WHERE `WebLang` = $Lang LIMIT 1 ;";
	if($db->ExecuteSQL($SQL)){
		AdminLog(1,$Lang,'修改"网站基本设置"，结果：操作成功！');
		MsgBox (1,'网站基本设置修改成功！','1');
	} else {
		AdminLog(1,$Lang,'修改"网站基本设置"，结果：操作失败！');
		MsgBox (1,'操作失败，请检查您提交的数据中是否含有非法字符！','0');
	}
}
$SQL = "SELECT `WebTitle`,`WebLogo`,`WebDescription`,`Webkeyword`,`WebCopyright`,`WebEmail`,`WebQQ`,`WebMSN`,";
$SQL .= "`WebTel1`,`WebTel2`,`WebFax`,`WebAddress`,`WebIP`,`WebDate`,`WebAdminName` FROM `" . $dbprefix . "webconfig` WHERE WebLang = " . $Lang;
$Rs = $db->SelectSQL($SQL,0);
Html($Rs[0]);
$WebTitle = $Rs[0][0];
$WebLogo = $Rs[0][1];
$WebDescription = $Rs[0][2];
$Webkeyword = $Rs[0][3];
$WebCopyright = $Rs[0][4];
$WebEmail = $Rs[0][5];
$WebQQ = $Rs[0][6];
$WebMSN = $Rs[0][7];
$WebTel1 = $Rs[0][8];
$WebTel2 = $Rs[0][9];
$WebFax = $Rs[0][10];
$WebAddress = $Rs[0][11];
$WebIP = $Rs[0][12];
$WebDate = $Rs[0][13];
$WebAdminName = $Rs[0][14];
unset($Rs,$SQL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./images/adminstyle.css" rel="stylesheet" type="text/css" />
<link rel="Shortcut Icon" href="../favicon.ico">
<link rel="Bookmark" href="../favicon.ico">
<script src="../js/csshovernotie6.js" type="text/javascript"></script>
<style type="text/css">
.sub{
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-right-color: #CCCCCC;
	border-bottom-color: #CCCCCC;
	border-left-color: #CCCCCC;
}
</style>
<script language="javascript">
function CheckForm() {
	if (document.form1.WebTitle.value.length < 2)	{
		alert("请输入网站标题！")
		document.form1.WebTitle.focus()
		return false
	}
<?php if($ConfigWebContact==1){ ?>	
	if (document.form1.WebEmail.value.match(/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/)==null)	{
		alert("请输入正确的企业邮箱！")
		document.form1.WebEmail.focus()
		return false
	}
<?php }?>
}
</script>
</head>

<body>
<br />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr class="Notodd"><td><?php TopLang();?></td>
	<td align="right"><input type="button" value="系统全局设置" onClick="javascript:location.href='WebSystem.php?Lang=<?php echo $Lang?>'"></td>
	</tr>
</table>
<form id="form1" name="form1" method="post" action="" style="margin:0px; display:inline;" onSubmit="return CheckForm()">
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
  <tr class="odd">
    <td colspan="3" align="center" class="Main_Title">网站基本设置<?php echo $OnWebLangName?></td>
  </tr>
  <tr class="odd">
    <td width="16%" align="right">网站标题：</td>
    <td width="38%"><input name="WebTitle" type="text" class="input2" id="WebTitle" value="<?php echo $WebTitle?>" maxlength="100" />
      <span class="red">*</span></td>
    <td>&nbsp;</td>
  </tr>
<?php if($ConfigWebLogo==1){?>  
  <tr class="odd">
    <td width="16%" align="right">Logo地址：</td>
    <td width="38%"><input name="WebLogo" type="text" class="input2" id="WebLogo" value="<?php echo $WebLogo?>" maxlength="100" />
	</td>
    <td>相对于当前模板目录</td>
  </tr>
<?php } if($ConfigWebSEO==1){?>  
    <tr class="odd">
    <td align="right">网站关键字：</td>
    <td><input name="Webkeyword" type="text" class="input2" id="Webkeyword" value="<?php echo $Webkeyword?>" maxlength="200" /></td>
    <td>将被搜索引擎用来搜索您网站的关键内容,用英文逗号&quot;<font color="#FF0000">,</font>&quot;隔开</td>
  </tr>
  <tr class="odd">
    <td align="right">网站描述：</td>
    <td><input name="WebDescription" type="text" class="input2" id="WebDescription" value="<?php echo $WebDescription?>" maxlength="200" /></td>
    <td>将被搜索引擎用来说明您网站的主要内容,最多200个字符</td>
  </tr>
<?php } if($ConfigWebCopyright==1){?>  
  <tr class="odd">
    <td align="right">版权信息：</td>
    <td><textarea name="WebCopyright" id="WebCopyright" cols="35" rows="4"><?php echo $WebCopyright?></textarea></td>
    <td>在网站底部显示,支持Html语法</td>
  </tr>
<?php }  if($ConfigWebContact==1){?>  
   <tr class="odd">
    <td width="16%" align="right">企业邮箱：</td>
    <td width="38%"><input name="WebEmail" type="text" class="input2" id="WebEmail" value="<?php echo $WebEmail?>" maxlength="50" />
      <span class="red">*</span></td>
    <td width="46%">联系我们、客户询盘、客户服务及在线反馈等信息均发送到该邮箱</td>
  </tr>
  <tr class="odd">
    <td align="right">客服Q Q：</td>
    <td><input name="WebQQ" type="text" class="input2" id="WebQQ" value="<?php echo $WebQQ?>" maxlength="20" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr class="odd">
    <td align="right">MSN：</td>
    <td><input name="WebMSN" type="text" class="input2" id="WebMSN" value="<?php echo $WebMSN?>" maxlength="50" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr class="odd">
    <td align="right">联系电话：</td>
    <td><input name="WebTel1" type="text" class="input2" id="WebTel1" value="<?php echo $WebTel1?>" maxlength="30" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr class="odd">
    <td align="right">客服电话：</td>
    <td><input name="WebTel2" type="text" class="input2" id="WebTel2" value="<?php echo $WebTel2?>" maxlength="30" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr class="odd">
    <td align="right">公司传真：</td>
    <td><input name="WebFax" type="text" class="input2" id="WebFax" value="<?php echo $WebFax?>" maxlength="30" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr class="odd">
    <td align="right">公司地址：</td>
    <td><input name="WebAddress" type="text" class="input2" id="WebAddress" value="<?php echo $WebAddress?>" maxlength="100" /></td>
    <td>&nbsp;</td>
  </tr>
<?php }?>  
  </table>

<table width="98%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#CCCCCC" class="sub">
   <tr class="odd">
     <td width="16%" height="25" align="right">&nbsp;</td>
     <td><input type="submit" name="button" id="button" value="提 交" class="submit" />
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="reset" name="button2" id="button2" value="重 置" class="submit" />
      <input name="Action" type="hidden" id="Action" value="UpDate" /></td>
     <td align="right" style="color:#666666;">
     最后一次修改时间：<font class="Igreen"><?php echo $WebDate?></font>&nbsp;|
     修改者：<font class="Igreen"><?php echo $WebAdminName?></font>&nbsp;|
     修改者IP：<a target="_blank" href="../inc/gettopost.php?Action=IP&IP=<?php echo $WebIP?>"><?php echo $WebIP?></a></td>
   </tr>
</table>
</form>
</body>
</html>
